<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      box-sizing: border-box;
      padding: 0;
    }
    .form-group {
      margin-bottom: 20px;
    }
    .form-group label {
      line-height: 30px;
    }
    .form-control {
      font-family: inherit;
      padding: 3px 8px;
    }
    .form-vertical .form-control,
    .form-horizontal .form-control {
      width: 100%;
    }
    .btn {
      font-family: inherit;
      padding: 3px 8px;
      cursor: pointer;
    }
    @media screen and (min-width:768px) {
      .form-horizontal .form-group {
        white-space: nowrap;
      } 
      .form-horizontal .form-group label {
        display: inline-block;
        padding-right: 20px;
        text-align: right;
        min-width: 80px;
      }
      .form-horizontal .form-control {
        width: calc(100% - 80px);
      }    
    }
  </style>
</head>

<body>
  <h1>表单响应式方案</h1>

  <h2>内联表单方案</h2>
  <form class="form-inline">  
    <label for="">账号</label>
    <input type="text"  class="form-control">
    <label for="">密码</label>
    <input type="password"  class="form-control">
    <button class="btn">登录</button> 
  </form>

  <h2>垂直表单方案</h2>
  <form class="form-vertical"> 
    <div class="form-group">
      <label for="">账号</label>
      <input type="text"  class="form-control">
    </div>
    <div class="form-group">
      <label for="">密码</label>
      <input type="password"  class="form-control">
    </div>
    <div class="form-group">
      <button class="btn">登录</button>
    </div>
  </form> 

  <h2>水平表单方案</h2>
  <form class="form-horizontal"> 
    <div class="form-group">
      <label for="">用户名</label>
      <input type="text"  class="form-control">
    </div>
    <div class="form-group">
      <label for="">密码</label>
      <input type="password"  class="form-control">
    </div>
    <div class="form-group">
      <button class="btn">登录</button>
    </div>
  </form> 
 
</body>

</html>